﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true"
    CodeFile="ThanhToanVayNganHang.aspx.cs" Inherits="ThanhToanVayNganHang" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success margin">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Thanh toán tiền vay ngân hàng</h3>
                </div>
                <div class="panel-body">
                    <table width="100%">
                        <tr>
                            <td width="14%">
                                <span style="margin-left: 5px;">Tháng</span><br />
                                <asp:DropDownList ID="dlthang" runat="server" CssClass="form-control with98" AutoPostBack="true"
                                    OnSelectedIndexChanged="dlthang_SelectedIndexChanged">
                                    <asp:ListItem Text="Chọn tháng" Value=""></asp:ListItem>
                                    <asp:ListItem Text="Tháng 1" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 2" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 3" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 4" Value="4"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 5" Value="5"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 6" Value="6"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 7" Value="7"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 8" Value="8"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 9" Value="9"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 10" Value="10"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 11" Value="11"></asp:ListItem>
                                    <asp:ListItem Text="Tháng 12" Value="12"></asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator1" runat="server"
                                    ControlToValidate="dlThang" ErrorMessage="Chọn thời gian" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td width="14%">
                                Năm<br />
                                <asp:DropDownList ID="dlNam" runat="server" CssClass="form-control">
                                </asp:DropDownList>
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Ngân hàng</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlnganhang"
                                    DataValueField="IDs" DataTextField="nganhang" AutoPostBack="true" OnSelectedIndexChanged="dlnganhang_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Số tiền gốc</span><br />
                                <asp:TextBox ID="txttiengoc" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Số tiền gốc đã trả</span><br />
                                <asp:TextBox ID="TextBox1" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Số tiền còn lại</span><br />
                                <asp:TextBox ID="txtsotienconlai" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Số tiền lãi tháng này</span><br />
                                <asp:TextBox ID="txttienlaithangnay" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="14%">
                                <span style="margin-left: 5px;">Số tiền lãi phải trả tháng này</span><br />
                                <asp:TextBox ID="txttienlaiphaitra" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Số tiền gốc tháng này</span><br />
                                <asp:TextBox ID="txttiengocthangnay" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Tiền gốc phải trả tháng này</span><br />
                                <asp:TextBox ID="txttiengocphaitra" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Số tiền lãi đã trả tháng này</span><br />
                                <asp:TextBox ID="txttienlaidatra" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Số tiền gốc đã trả tháng này</span><br />
                                <asp:TextBox ID="txttiengocdatra" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Số thanh toán tiền lãi</span><br />
                                <asp:TextBox ID="txtsothanhtoantienlai" runat="server" CssClass="form-control with98"></asp:TextBox>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender6" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtsothanhtoantienlai" ValidChars=",." />
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Số thanh toán tiền gốc</span><br />
                                <asp:TextBox ID="txtsothanhtoantiengoc" runat="server" CssClass="form-control with98"></asp:TextBox>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender7" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtsothanhtoantiengoc" ValidChars=",." />
                            </td>
                        </tr>
                        <tr>
                            <td width="14%">
                                <span style="margin-left: 5px;">Ngày thanh toán tiền lãi</span><br />
                                <asp:TextBox ID="txtngaythanhtoanlai" runat="server" CssClass="form-control with98"></asp:TextBox>
                                <cc1:CalendarExtender PopupPosition="BottomRight" ID="CalendarExtender1" runat="server"
                                    TargetControlID="txtngaythanhtoanlai" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtngaythanhtoanlai" ValidChars="/" />
                            </td>
                            <td width="14%">
                                <span style="margin-left: 5px;">Ngày thanh toán tiền gốc</span><br />
                                <asp:TextBox ID="txtngaythanhtoantiengoc" runat="server" CssClass="form-control with98"></asp:TextBox>
                                <cc1:CalendarExtender PopupPosition="BottomRight" ID="CalendarExtender2" runat="server"
                                    TargetControlID="txtngaythanhtoantiengoc" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtngaythanhtoantiengoc" ValidChars="/" />
                            </td>
                            <td width="14%">
                                Hình thức thanh toán lãi
                                <asp:DropDownList ID="drhinhthucthanhtoanlai" CssClass="form-control" runat="server"
                                    Visible="true">
                                    <asp:ListItem Value="0" Text="Chọn hình thức thanh toán"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="Ngân hàng"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="Tiền mặt"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td width="14%">
                                <asp:Label ID="Label2" runat="server" Visible="true">  Tài khoản</asp:Label>&nbsp;lãi<br />
                                <asp:DropDownList ID="drtaikhoanthanhtoanlai" Visible="true" DataTextField="TaiKhoan"
                                    DataValueField="IDs" CssClass="form-control" runat="server">
                                </asp:DropDownList>
                            </td>
                            <td width="14%">
                                Hình thức thanh toán gốc
                                <asp:DropDownList ID="drhinhthucthanhtoangoc" CssClass="form-control" runat="server"
                                    Visible="true">
                                    <asp:ListItem Value="0" Text="Chọn hình thức thanh toán"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="Ngân hàng"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="Tiền mặt"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td width="14%">
                                <asp:Label ID="Label1" runat="server" Visible="true">  Tài khoản</asp:Label>&nbsp;gốc<br />
                                <asp:DropDownList ID="drtaikhoanthanhtoangoc" Visible="true" DataTextField="TaiKhoan"
                                    DataValueField="IDs" CssClass="form-control" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6">
                                <asp:Button ID="btnSave" ValidationGroup="Them" runat="server" Style="margin-left: 5px;"
                                    Text="Lưu lại" CssClass="btn btn-primary" OnClick="btnSave_Click" />
                                <asp:Button ID="btncapnhat" runat="server" Text="Cập nhật" CssClass="btn btn-info"
                                    OnClick="btncapnhat_Click" Visible="false" />
                                <asp:Button ID="btnCancel" runat="server" Text="Nhập mới" CssClass="btn btn-warning"
                                    OnClick="btnCancel_Click" />
                            </td>
                        </tr>
                    </table>
                    <asp:ValidationSummary ID="ValidationSummary1" HeaderText="Bạn phải nhập các trường sau:"
                        ShowMessageBox="true" ValidationGroup="Them" ShowSummary="false" EnableClientScript="true"
                        runat="server" />
                </div>
            </div>
            <div style="margin: 5px;">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        Danh sách thanh toán</div>
                    <div class="panel-heading">
                        <br />
                        <asp:DropDownList runat="server" CssClass="form-control width98" ID="DropDownList1" Width="200px"
                            DataValueField="IDs" DataTextField="nganhang">
                        </asp:DropDownList>
                        <asp:Button ID="Button1" runat="server" Text="Tìm kiếm" CssClass="btn btn-info" onclick="Button1_Click"
                                      />
                    </div>
                    <div style="width: 100%; margin-top: 0px;" class="wrapper">
                        <asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" ShowFooter="false" CssClass="form-control withall"
                            Width="99%" OnRowCommand="GV_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="Xóa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                    ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbXoa" runat="server" Width="20px" Height="20px" ImageUrl="~/img/delete-24.png"
                                            OnClientClick="return confirm('Bạn chắc chắn muốn xóa ?')" CommandArgument='<%#Eval("IDs")%>'
                                            Text="Xóa" CommandName="Del" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Sửa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                    ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbSua" runat="server" Width="15px" Height="15px" ImageUrl="~/img/edit.ico"
                                            CommandArgument='<%#Eval("IDs")%>' Text="Sửa" CommandName="Select" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="tenncc" ItemStyle-CssClass="padding" HeaderText="Ngân hàng"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="sotienlai" ItemStyle-CssClass="padding" HeaderText="Số tiền lãi"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="sotiengoc" ItemStyle-CssClass="padding" HeaderText="Số tiền gốc"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="ngaythanhtoanlai" ItemStyle-CssClass="padding" HeaderText="Ngày thanh toán lãi"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="NgayThanhToanGoc" ItemStyle-CssClass="padding" HeaderText="Ngày thanh toán gốc"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="HinhThucLai" ItemStyle-CssClass="padding" HeaderText="Hình thức lãi"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="HinhThucGoc" ItemStyle-CssClass="padding" HeaderText="Hình thức gốc"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="taikhoanlai" ItemStyle-CssClass="padding" HeaderText="Tài khoản lãi"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="taikhoangoc" ItemStyle-CssClass="padding" HeaderText="Tài khoản gốc"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Left" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                        <div style="margin: 5px;">
                            <asp:Button ID="btnFirst" runat="server" Text="Đầu" CssClass="btn btn-primary" OnClick="btnFirst_Click" />
                            <asp:Button ID="btnPre" runat="server" Style="margin-left: 5px;" Text="Trước" CssClass="btn btn-primary"
                                OnClick="btnPre_Click" />
                            <asp:Button ID="btnNext" runat="server" Style="margin-left: 5px;" Text="Sau" CssClass="btn btn-warning"
                                OnClick="btnNext_Click" />
                        </div>
                    </div>
                </div>
                <asp:HiddenField ID="hdID" runat="server" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
